<template>
  <div class="container">
    <div class="new"  @click="$router.push(`/activity/activitydetail/${id}`)">
      <img :src="pic" alt="" />
      <div class="newtext">
        <h3>
          <span>{{ competition_type }}</span>
          {{ title }}
        </h3>
        <div>
          <p>报名时间: {{ time }}</p>
          <span>{{ number }} 人已参与</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: "标题",
    },
    pic: {
      type: String,
      required: true,
    },
    time: {
      type: String,
      default: "00.00-00.00",
    },
    number: {
      type: Number,
      default: 0,
    },
    competition_type: {
      type: String,
      default: "",
    },
    id: {
      type: Number,
      required: true,
    },
  },
};
</script>

<style lang="scss" scoped>
.container {
  .new {
    margin: 10px 5px;
    text-align: left;
    display: flex;
    justify-content: space-between;
    height: 90px;
    img {
      width: 146px;
      height: 90px;
    }

    .newtext {
      width: 214px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      h3 {
        font-weight: 400;
        font-size: 16px;
        // 显示两行,文本超出部分 用... 展示
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        > span {
          font-size: 16px;
          color: #a727d9;
          display: inline-block;
          padding-right: 8px;
        }
      }
      p {
        color: #666;
        font-size: 12px;
        padding: 8px 0;
      }
      span {
        font-size: 12px;
        color: #666;
      }
    }
  }
}
</style>
